﻿$(document).ready(function () {
        onmenuload();
});
    function onmenuload() {
        loadAndShowMenu('http://localhost:6572/Home/getmenu');
}
loadAndShowMenu = function (url) {
   
    $.ajax({
        type: "POST",
        url: url,
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            alert($("#topnav ul").html());
            alert(msg.UserName);
        },
        error: function (err) {
            alert(err.toString());
            if (err.status == 200) {
              //  ParseResult(err);
            }
            else { alert('Error:' + err.responseText + '  Status: ' + err.status); }
        }
    });
};